#include <cstdio>
#include "Tree.h"

int main(int argc, char **argv)
{
	TreeNode* tree = CreateTree();

	//PreOrderVisitTreeR(tree);
	//printf("PreOrderVisitTree end\n");

	//MidOrderVisitTreeR(tree);
	//printf("MidOrderVisitTree end\n");

	//PostOrderVisitTreeR(tree);
	//printf("PostOrderVisitTree end\n");

	//LayerVisitTree(tree);
	//printf("LayerVisitTree end\n");

	//DepthVisitTreeR(tree);
	//printf("DepthVisitTreeR end\n");

	//DepthVisitTree(tree);
	//printf("DepthVisitTree end\n");
	
	int max = 0;
	int min = 0;
	MaxMinDepth(tree, max, min);
	printf("MaxMinDepth max %d min %d\n", max, min);

	//if (ValidateBST1(tree, -100000))
	//{
	//	printf("ValidateBST1 true\n");
	//}
	//else
	//{
	//	printf("ValidateBST1 false\n");
	//}

	//if (ValidateBST2(tree, -1000000, 1000000))
	//{
	//	printf("ValidateBST2 true\n");
	//}
	//else
	//{
	//	printf("ValidateBST2 false\n");
	//}

	//TreeNode* result = LowestCommonAncestor1(tree, 9, 6);
	//if (result)
	//{
	//	printf("LowestCommonAncestor1 %d\n", result->val);
	//}
	//else
	//{
	//	printf("LowestCommonAncestor1 null\n");
	//}

	//TreeNode* result = LowestCommonAncestor2(tree, 9, 6);
	//if (result)
	//{
	//	printf("LowestCommonAncestor2 %d\n", result->val);
	//}
	//else
	//{
	//	printf("LowestCommonAncestor2 null\n");
	//}

	//TreeNode* result = LowestCommonAncestor3(tree, 9, 6);
	//if (result)
	//{
	//	printf("LowestCommonAncestor3 %d\n", result->val);
	//}
	//else
	//{
	//	printf("LowestCommonAncestor3 null\n");
	//}

	return 0;
}